package com.drug.controller;

import com.drug.domain.Result;
import com.drug.service.SelectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/select")
public class SelectController {

    @Autowired
    private SelectService selectService;

    /**
     * 按采购单查询
     * @param map
     * @param pageNum
     * @return
     */
    @RequestMapping("/findcaigoudan")
    @ResponseBody
    private Result findcaigouadan(@RequestParam Map<String,Object> map, @RequestParam(required=true,defaultValue="1")Integer pageNum){
        return selectService.findcaigouadan(map,pageNum);
    }

    /**
     * 按供货商查询
     * @param map
     * @param pageNum
     * @return
     */
    @RequestMapping("/findghs")
    @ResponseBody
    private Result findghs(@RequestParam Map<String,Object> map, @RequestParam(required=true,defaultValue="1")Integer pageNum){
        return selectService.findghs(map,pageNum);
    }
    /**
     * 按医院查询
     * @param map
     * @param pageNum
     * @return
     */
    @RequestMapping("/findyiyuan")
    @ResponseBody
    private Result findyiyuan(@RequestParam Map<String,Object> map, @RequestParam(required=true,defaultValue="1")Integer pageNum){
        return selectService.findyiyuan(map,pageNum);
    }
}
